package com.voice.call.common;

public enum ResultEnum {
	
	SUCCESS(0,"success"),
	FAILED(-1,"failed"),
	IP_ACCESS_ERROR(101,"ip not allow access"),
	HTTP_CONNECT_ERROR(404,"service error"),
	SYSTEM_ERROR(500,"system error"),
	PARAM_ERROR(1001,"illegal param"),
	XML_PARSE_ERROR(1002,"xml error"),
	JSON_PARSE_ERROR(1003,"json error"),
	SIGN_ERROR(1004,"signature verify failed"),
	USER_NOT_EXIST(1005,"user not find"),
	USER_FROZEN(1006,"user frozen"),
	USER_PASSWORD_ERROR(1007,"wrong password"),
	USER_ILLEGAL(1008,"illegal request"),
	SMS_SEND_LIMIT(1009,"sms code send over limit"),
	SMS_SEND_FAIL(1010,"sms code send fail"),
	SMS_INVALID(1011,"invalid sms code"),
	TOKEN_UPDATE_FAILED(1012,"token update fail"),
	TOKEN_INVALID(1013,"token error"),
	USER_PHONE_BIND_ERROR(1014,"phone number bind error"),
	TOKEN_EXPRIED(1015,"token expired"),
	ALLOW_AUTO_REGISTER(1016,"auto register"),
	ALLOW_FB_REGISTER(1017,"use fb register"),
	ALLOW_PHONE_VCODE_REGISTER(1018,"use phone & verifycode"),
	NOT_ALLOW_REGISTER(1019,"not allow register"),
	USER_CHECKIN(1020,"has checked-in"),
	LUCKY_CREDIT_LIMIT(1021,"over max play count"),
	INVITE_CODE_ERROR(1022,"invalid promotion code"),
	INVITE_CODE_EXPRIED(1023,"promotion expired"),
	USER_EXISTS_INVITE(1024,"user already invited"),
	INTEGRAL_LIMIT_ERROR(1025,"over max credits limit"),
	TASK_GIFT_ERROR(1026,"credit gift offline"),
	REGISTER_MCC_ERROR(1027,"area not support register"),
	LUCKY_CREDIT_EXCHANGE_ILLEGAL(1028,"illegal id for play game"),
	USER_LEVEL_NOT_EXISTS(1029,"illegal id for level"),
	USER_LEVEL_NOT_ARRIVED(1030,"level not arrived"),
	USER_LEVEL_RECEIVE_ERROR(1031,"got credits"),
	TASK_INTEGRAL_CONFIG_ERROR(1032,"this class don't have config"),
	TASK_EXCHANGE_ERROR(1033,"don't use same code again"),
	INVITE_USER_SELF_ERROR(1034,"can’t invited self"),
	LATEST_VERSION(1035, "The current version is the latest version"),
	ILLEGAL_INTERVAL_ERROR(1036, "Maybe  you need  using vpn to get credites well"),
	INVALID_PHONE_ERROR(1037,"Invalid phone number, please check"),
	DOWNLOAD_VERSION(1038,"please download the latest version"),
	SMS_SENDING_ERROR(1039,"SMS is being sent, please wait"),
	LOGIN_EXCEPTION(1040,"Login exception"),
	INVALID_MOBILE_ERROR(1041,"Invalid mobile number"),
	REQUEST_FREQUENCY_LIMIT(1042,"Request too frequently");
	
	/**
	SUCCESS(0,"成功"),
	FAILED(-1,"失败"),
	IP_ACCESS_ERROR(101,"ip访问受限制"),
	HTTP_CONNECT_ERROR(404,"远程服务异常"),
	SYSTEM_ERROR(500,"系统错误"),
	PARAM_ERROR(1001,"参数不合法"),
	XML_PARSE_ERROR(1002,"xml解析异常"),
    JSON_PARSE_ERROR(1003,"json解析异常"),
	SIGN_ERROR(1004,"签名验证失败"),
	USER_NOT_EXIST(1005,"用户不存在"),
	USER_FROZEN(1006,"用户已经被冻结"),
	USER_PASSWORD_ERROR(1007,"用户密码错误"),
	USER_ILLEGAL(1008,"非法请求用户"),
	SMS_SEND_LIMIT(1009,"短信发送超出限制"),
	SMS_SEND_FAIL(1010,"短信发送失败"),
	SMS_INVALID(1011,"短信验证码无效"),
	TOKEN_UPDATE_FAILED(1012,"token更新失败"),
	TOKEN_INVALID(1013,"token错误"),
	USER_PHONE_BIND_ERROR(1014,"手机号码被绑定"),
	TOKEN_EXPRIED(1015,"token已过期"),
	ALLOW_AUTO_REGISTER(1016,"使用自动注册"),
	ALLOW_FB_REGISTER(1017,"使用FB注册"),
	ALLOW_PHONE_VCODE_REGISTER(1018,"使用手机+验证码注册"),
	NOT_ALLOW_REGISTER(1019,"不允许注册"),
	USER_CHECKIN(1020,"当天用户已签到"),
	LUCKY_CREDIT_LIMIT(1021,"超过当天最大可玩次数"),
	INVITE_CODE_ERROR(1022,"无效邀请码"),
	INVITE_CODE_EXPRIED(1023,"邀请码已过期"),
	USER_EXISTS_INVITE(1024,"当前用户已被邀请"),
	INTEGRAL_LIMIT_ERROR(1025,"超过当日获取积分最大限制"),
	TASK_GIFT_ERROR(1026,"送积分活动已下线"),
	REGISTER_MCC_ERROR(1027,"当前地区不支持注册使用"),
	LUCKY_CREDIT_EXCHANGE_ILLEGAL(1028,"老虎机非法兑换id"),
	USER_LEVEL_NOT_EXISTS(1029,"非法领取id"),
	USER_LEVEL_NOT_ARRIVED(1030,"用户等级未达到不可领取"),
	USER_LEVEL_RECEIVE_ERROR(1031,"积分已领取"),
	TASK_INTEGRAL_CONFIG_ERROR(1032,"当前类别未配置积分"),
	TASK_EXCHANGE_ERROR(1033,"当前id积分已兑换，不要重复兑换"),
	INVITE_USER_SELF_ERROR(1034,"不能自已邀请自已");
	**/
	
	private int code;
	private String msg;
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	private ResultEnum(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}
	
	public static ResultEnum getEnumByCode(int code) {
        for (ResultEnum bt : values()) {
            if (bt.code == code) {
                return bt;
            }
        }
        return null;
    }
}
